# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from blogpy.blog.myfeeds import *
from blogpy.blog.models import Post
from django.conf import settings

feeds = {   
    'blogrss': blogrss,
    'commentrss': commentrss,  
}

urlpatterns = patterns('blogpy.blog',
    # Example:
    (r'^$', 'views.index'),
    (r'^login/$', 'common.login'), 
    (r'^logout/$', 'common.logout'), 
    (r'^blog/(\d+)/$', 'views.post'),
    (r'^page/(\d+)/$', 'views.index'),
    (r'^blog/catalog/(\d+)/$', 'views.getCatalog'),
    (r'^blog/recomments/$', 'views.recomment'),
    (r'^archives/(?P<year>\d{4})/(?P<month>\d{2})/$', 'views.archives'),
    (r'^tag/(\d+)/$', 'views.getTag'),
    (r'^add_blog/$', 'common.addBlog'),
    (r'^edit_blog/(\d+)/$$', 'common.editBlog'),
    (r'^del_blog/(\d+)/$$', 'common.delBlog'),
)
urlpatterns += patterns('',
    #feeds
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',{'feed_dict': feeds}),
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^editor/(.*)$', 'django.views.static.serve',{'document_root': 'templates/editor'}),
    
    (r'^blogstatic/(.*)$', 'django.views.static.serve',{'document_root': '%s/static'%(settings.THEME_STATIC)}),
)
